package com.ex.model;
// Generated 2018-7-14 23:34:36 by Hibernate Tools 4.3.5.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Target;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * TStudent generated by hbm2java
 */
@Entity
@Table(name = "t_student", catalog = "huaqiao")
public class TStudent implements java.io.Serializable {

	private Integer id;
	private TClass TClass;
	private String name;
	private String code;
	private String weixinId;
	private String mobile;
	private String password;
	private String cordNo;
	private String parentName;
	private String parentMobile;
	private String parentName2;
	private String parentMobile2;
	private Date modifiedTime;
	private Integer modifiedBy;
	private Set TParents = new HashSet(0);
	private Set TOutRequests = new HashSet(0);

	public TStudent() {
	}

	public TStudent(String name, String code, String password) {
		this.name = name;
		this.code = code;
		this.password = password;
	}

	public TStudent(TClass TClass, String name, String code, String weixinId, String mobile, String password,
			String cordNo, String parentName, String parentMobile, String parentName2, String parentMobile2,
			Date modifiedTime, Integer modifiedBy, Set TParents, Set TOutRequests) {
		this.TClass = TClass;
		this.name = name;
		this.code = code;
		this.weixinId = weixinId;
		this.mobile = mobile;
		this.password = password;
		this.cordNo = cordNo;
		this.parentName = parentName;
		this.parentMobile = parentMobile;
		this.parentName2 = parentName2;
		this.parentMobile2 = parentMobile2;
		this.modifiedTime = modifiedTime;
		this.modifiedBy = modifiedBy;
		this.TParents = TParents;
		this.TOutRequests = TOutRequests;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

//	@ManyToOne(fetch = FetchType.EAGER)
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name = "class_id")
	public TClass getTClass() {
		return this.TClass;
	}

	public void setTClass(TClass TClass) {
		this.TClass = TClass;
	}

	@Column(name = "name", nullable = false, length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "code", nullable = false, length = 30)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "weixin_id", length = 100)
	public String getWeixinId() {
		return this.weixinId;
	}

	public void setWeixinId(String weixinId) {
		this.weixinId = weixinId;
	}

	@Column(name = "mobile", length = 20)
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name = "password", nullable = false, length = 100)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "cord_no", length = 100)
	public String getCordNo() {
		return this.cordNo;
	}

	public void setCordNo(String cordNo) {
		this.cordNo = cordNo;
	}

	@Column(name = "parent_name", length = 100)
	public String getParentName() {
		return this.parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	@Column(name = "parent_mobile", length = 20)
	public String getParentMobile() {
		return this.parentMobile;
	}

	public void setParentMobile(String parentMobile) {
		this.parentMobile = parentMobile;
	}

	@Column(name = "parent_name2", length = 100)
	public String getParentName2() {
		return this.parentName2;
	}

	public void setParentName2(String parentName2) {
		this.parentName2 = parentName2;
	}

	@Column(name = "parent_mobile2", length = 20)
	public String getParentMobile2() {
		return this.parentMobile2;
	}

	public void setParentMobile2(String parentMobile2) {
		this.parentMobile2 = parentMobile2;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "modified_time", length = 19)
	public Date getModifiedTime() {
		return this.modifiedTime;
	}

	public void setModifiedTime(Date modifiedTime) {
		this.modifiedTime = modifiedTime;
	}

	@Column(name = "modified_by")
	public Integer getModifiedBy() {
		return this.modifiedBy;
	}

	public void setModifiedBy(Integer modifiedBy) {
		this.modifiedBy = modifiedBy;
	}

	@OneToMany(targetEntity=TParent.class,fetch = FetchType.EAGER, mappedBy = "TStudent")
	public Set getTParents() {
		return this.TParents;
	}

	public void setTParents(Set TParents) {
		this.TParents = TParents;
	}

	@OneToMany(targetEntity=TOutRequest.class,fetch = FetchType.EAGER, mappedBy = "TStudent")
	public Set getTOutRequests() {
		return this.TOutRequests;
	}

	public void setTOutRequests(Set TOutRequests) {
		this.TOutRequests = TOutRequests;
	}

}
